/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.worlds.input;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import net.worlds.WorldsCLI;

/**
 *
 * @author Jacob
 */
public class ConsoleReader implements Runnable{
    private static final BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

    public void run() {
        while(!WorldsCLI.exit)
        {
            try
            {
                while(r.ready())
                {
                    String message = r.readLine();
                    if(message.equals("stop"));
                        WorldsCLI.exit = true;
                }
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
            try {
                Thread.sleep(100);
            } catch (InterruptedException ex) {
            }
        }
    }
}
